<script type="text/javascript">
function facebook_update(post_id){
    var ajax = new Ajax();
    ajax.responseType = Ajax.FBML;
    ajax.post('<?php echo get_bloginfo('url'); ?>/?page=stFacebookToolbox&action=display_facebook_feeds&ajax=1&id='+post_id);
    return false
}
</script>
<?php
?>
<div id="fbContainer">

    <style type="text/css">
        <?php
        echo htmlentities(file_get_contents($config["backendCss"].'editor-style.css', true));
        echo htmlentities(file_get_contents($config["backendCss"].'facebook.css', true));
        ?>
    </style>
    <div class="header" >
        <?php //include( 'header.php' );?>
    </div>
    <div id="main">

            <?php

           $args = array(
                'post_type' => 'post',
                'showposts' => $option['number']
            );
           if(count($categories) > 0)
           {
               foreach($categories as $key=>$value)
                {
                    $number[] = $key;
                }
                 if(count($number) > 0)
                {
                    $cat = implode(',',$number);
                }
                $args['cat'] = $cat;
           }

            query_posts( $args );
            if (have_posts ())
            while (have_posts ()) : the_post();
                ?>
                <div class="tw462 tmc tp10b">
                    <b class="t_blue"><a onclick="facebook_update('<?php the_ID()?>');" href="<?php the_permalink() ?>"><?php the_title(); ?></a></b>
                    <p class="t_gray">
                    <?php
                    if($option['date'] == 1)
                        the_date();

                    if($option['author'] == 1){
                        echo ' '.$option['by'].' ';
                        the_author();
                    }
                    ?>
                    </p>
                    <?php
                    global $post;
                    $mycontent = $post->post_content;
                    $excerpt= $model->getCustomExcerpt($mycontent, $option['excerpt'], get_the_ID());
                   echo "<p>$excerpt</p>";
                    ?>
                </div>
                <br clear="both" />
                <?php
            endwhile;

            ?>
    </div>
    <img alt=""
        src='http://ga.webdigi.co.uk/fbga.php?googlecode=<?php echo $tab['id']?>&googledomain=facebook.com&pagelink=/<?php echo $page_site?>&pagetitle=<?php echo $page_title?>' />
</div>
